package strategy_tasarim_sablonu;

import java.io.FileOutputStream;
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;

/*
 *Bean sinifinin sahip oldugu  
 *degisken degerlerini zerialize
 *ederek bean.ser isimli
 *bir dosyaya yazar 
 * 
 * */

public class SerializeStrategy implements Strategy {

	@Override
	public void save(Bean bean) {
		
		try{
			
			ObjectOutput out = new ObjectOutputStream(new FileOutputStream("c:/deneme/bean.ser"));
			out.writeObject(bean);
			out.close();
		}
		catch (Exception e) {
			
			throw new RuntimeException(e);
		}
		
	}

}
